<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>花卉信息列表</title>
    <!--隔行变色，当id=ji时背景为黄色-->
    <style>#ji{background-color: yellow}</style>
</head>
<body>
<!--边框1px-->
<table border="1">
    <!--height,行内高度50px,跨列colspan7格-->
    <tr><th colspan="7" height="50">花卉信息列表</th></tr>

    <tr><th colspan="7" ><a th:href="add.html">增加花卉信息</a></th></tr>
    <tr>
        <th>花卉编号</th>
        <th>花卉名称</th>
        <th>别名</th>
        <th>科属</th>
        <th>价格（元/支）</th>
        <th>原产地</th>
        <th>操作</th>
    </tr>
    <!--th：each循环，id取名jk，li索引,even双数，以三元表达式写出当行数为双,id=jk-->
    <tr  th:each="list,li:${list}" th:id="${li.even ? 'jk':''}">
        <td th:text="${list.id}">1</td>
        <td th:text="${list.name}">矮牵牛</td>
        <td th:text="${list.anothername}">碧冬茄</td>
        <td th:text="${list.property}">茄科碧冬茄属</td>
        <td th:text="${list.price}">2.5</td>
        <td th:text="${list.production}">南美阿根廷</td>
        <td>
            <!--弹窗提示是否删除，th传值id-->
            <a onclick="return confirm('确认是否删除')" th:href="@{del(id=${list.id})}">删除</a>
            <a th:href="@{find(id=${list.id})}">修改</a>
        </td>
    </tr>

</table>

</body>
</html>